using JoyfulHomeJourney.BackEnd.Infrastructure.EFCore;
using JoyfulHomeJourney.BackEnd.Infrastructure.Dtos.Responses.Objects;
using JoyfulHomeJourney.BackEnd.Infrastructure.Tools;
namespace JoyfulHomeJourney.BackEnd.Server.Instances.Extends.Responses
{
	public static class SysCarServicesExtend
{
		public static ResponseSysCarServicesDto ToResponseDto(this SysCarServices entity,SysProducts product)
{			return new ResponseSysCarServicesDto
			{
				appointmentRequired = entity.CsAppointmentRequired,
				carShopId = entity.CsCarShopId,
				createAt = product.PCreateAt,
				createAtStr =Tools.TimeToString(product.PCreateAt),
				duration = entity.CsDuration,
				id = entity.CsId,
				productId = entity.CsProductId,
				serviceArea = entity.CsServiceArea,
				serviceType = entity.CsServiceType,
				updateAt = product.PUpdateAt,
				updateAtStr =Tools.TimeToString(product.PUpdateAt),
				name=product.PName,
				deduction=product.PDeduction,
				discount=product.PDiscount,
				description=product.PDescription,
				images=product.PImages,
				brand=product.PBrand,
				price=product.PPrice,
				productCategory=product.PCategory,
				rating=product.PRating,
				saleCount=product.PSaleCount,
				stockQuantity=product.PStockQuantity,
			};
		}
	}
}
